#!/bin/sh

[ "$(stat -c %y $XDG_CACHE_HOME/corona 2>&1 /dev/null | cut -d' ' -f1)" != "$(date '+%Y-%m-%d')" ]  &&
        curl -s https://corona-stats.online/states/us > $XDG_CACHE_HOME/corona

# RANK      STATE       TOTAL CASES         NEW CASES           TOTAL DEATHS        NEW DEATHS
grep "US\ States\|Illinois" $XDG_CACHE_HOME/corona |
        sed "s/\s*//g ; s/║//g ; s/│/;/g" |
        awk -F';' '{print $1 " " $2 " " $3 " " $4 " " $5 " " $6 " " $7 " " $8}' |
        sed "s/\x1b\[[0-9,;]*m//g"

